
import {HashRouter,Routes,Route,Navigate,BrowserRouter} from 'react-router-dom'
import Login from './pages/Login'
import NavPage from './pages/NavPage'
import React from 'react'
const Home=React.lazy(()=>import("./pages/NavPage/home"))
const Order=React.lazy(()=>import("./pages/NavPage/order"))
const AddShop=React.lazy(()=>import("./pages/NavPage/shops/AddShop"))
const ShopList=React.lazy(()=>import("./pages/NavPage/shops/ShopList"))
const AccountList=React.lazy(()=>import("./pages/NavPage/accounts/AccountList"))
const AddAccount=React.lazy(()=>import("./pages/NavPage/accounts/AddAccount"))
const Mine=React.lazy(()=>import("./pages/NavPage/mine"))
function App() {

  return (
    <React.Suspense fallback={<div>加载中...</div>}>
      <HashRouter>
        <Routes>
          <Route path='/' element={<Navigate to={'/login'}></Navigate>}/>
          <Route path='/login' element={<Login/>}/>
          <Route path='/nav' element={<NavPage/>}>
            <Route index element={<Home/>}/>
            <Route path='order' element={<Order/>}/>
            <Route path='addShop' element={<AddShop/>}/>
            <Route path='shopList' element={<ShopList/>}/>
            <Route path='accountList' element={<AccountList/>}/>
            <Route path='addAccount' element={<AddAccount/>}/>
            <Route path='mine' element={<Mine/>}/>
          </Route>
        </Routes>
      </HashRouter>
    </React.Suspense>
  )
}

export default App
